# 面向过程
student1 = {
    'name': '魏眀择',
    'age': 35,
    'score': 0
}
student2 = {
    'name': '小张',
    'age': 18,
    'score': 59
}
def set_score(student, new_score):
    if new_score < 0 or new_score > 100:
        print('您的输入有误，设置成绩失败')
        return
    student['score'] = new_score
    print('log:', student['name'], '的成绩被更改为', new_score)

def set_new_year_age(student):
    student['age'] += 1

def print_info(student):
    print('姓名：', student['name'],
          '年龄为：', student['age'], '的成绩是', student['score'])

set_score(student1, 60)
set_score(student2, 89)
set_score(student1, 999)
print_info(student1)
print_info(student2)

# 错误操作 student1['score'] = 99999


